# Maintainer: Giovanni Scafora <giovanni@archlinux.org>
# Contributor: Alexander 'dma147' Mieland <dma147@linux-stats.org>
# Contributor: Simon Morgan <simon@16hz.net>

pkgname=chmlib
pkgver=0.40
pkgrel=7
pkgdesc="Library for dealing with Microsoft ITSS/CHM format files"
arch=('loong64' 'x86_64')
url="http://www.jedrea.com/chmlib/"
license=('LGPL')
depends=('glibc')
source=("http://www.jedrea.com/chmlib/chmlib-0.40.tar.bz2"
    chmlib-fix-gcc13.patch)
sha256sums=('3449d64b0cf71578b2c7e3ddc048d4af3661f44a83941ea074a7813f3a59ffa3'
            'b5f792c16b01c9ad0a08e4f2c55134c0bb5d93096f1d5634fd65a0da8ac5ab9e')

prepare() {
	cd "$pkgname-$pkgver"
	patch -p1 -i "$srcdir/chmlib-fix-gcc13.patch"
}

build() {
  cd "${srcdir}"/${pkgname}-${pkgver}

  ./configure --prefix=/usr \
              --enable-examples=yes
  make
}

package() {
  cd "${srcdir}"/${pkgname}-${pkgver}

  make DESTDIR="${pkgdir}" install
}
